/**
 * 更多菜单
 */

'use strict'
import React,{Component} from 'react'
import {
    Modal,
} from 'react-native'

export default (WrappedComponent) => {
    class HigherComponent extends Component{
        state = {
            visible:false
        }

        show(){
            this.setState({
                visible:true
            })
        }

        dismiss(){
            // debugger
            this.setState({
                visible:false
            })
        }
        render(){
            const {onClose} = this.props;
            return (
                <Modal
                    transparent={true}
                    visible={this.state.visible}
                    onRequestClose={()=>onClose()}
                >
                    <WrappedComponent {...this.props} dismiss={this.dismiss} self={this}/>
                </Modal>
            )
        }

    }

    return HigherComponent
}
